package com.link.base.base.esb.service;

import com.link.base.base.accnt.model.Account;
import com.link.base.base.contract.model.BillInfo;
import com.link.base.base.contract.model.ModContract;
import com.link.base.base.contract.model.ReturnInfo;
import com.link.base.base.esb.model.EmployeeDTO;
import com.link.base.base.esb.model.EsbInfo;
import com.link.base.base.esb.model.OrgnizationDTO;
import com.link.base.base.esb.model.PositionDTO;

/**
 * 基础数据服务接口
 *
 * @author: liuqixin
 * @date: 2020/08/19 15:58
 */
public interface LinkBaseDataApiService {


    /**
     * 对来自ESB的员工数据进行新增或更新
     *
     * @author 刘启鑫
     * @date 2020/8/19 16:01
     */
    EsbInfo upsertForESB(EsbInfo esbInfo, EmployeeDTO employee);


    /**
     * 对来自ESB的组织数据进行新增或更新
     *
     * @author 刘启鑫
     * @date 2020/8/19 16:01
     */
    EsbInfo upsertForESB(EsbInfo esbInfo, OrgnizationDTO orgnization);


    /**
     * 对来自ESB的职位数据进行新增或更新
     *
     * @author 刘启鑫
     * @date 2020/8/19 16:01
     */
    EsbInfo upsertForESB(EsbInfo esbInfo, PositionDTO position);

    EsbInfo upsertForESB(EsbInfo esbInfo, BillInfo billInfo);

    EsbInfo upsertForESB(EsbInfo esbInfo, ReturnInfo requestInfo);

    /**
     * 查询ERP应收单发票并更新
     * @param
     * @return
     * @throws Exception
     */
    void upsertInvoiceInfoFromERP() throws Exception;

    /**
     * 查询ERP收款单信息并更新
     * @return
     * @throws Exception
     */
    void upsertReturnInfoFromERP() throws Exception;

    /**
     * 价格合同查询并调用ERP写入接口
     * @throws Exception
     */
    void syncPriContract(ModContract modContract) throws Exception;

    /**
     * 审批通过，同步客户信息至ERP
     * @param account
     * @return
     * @throws Exception
     */
    void syncAccountInfo(Account account) throws Exception;

    /**
     * 定时同步到本系统
     * 查询ERP物料编码信息并更新
     * @throws Exception
     */
    void upsertMaterialFromERP() throws Exception;

    /**
     * 客户变更审批通过，同步至erp
     * @param entity
     * @throws Exception
     */
    void syncAccountChange(Account entity) throws Exception;
}
